Release 10.1A: OpenEdge Development:
Progress 4GL Reference


COMPARE function

The COMPARE function compares two strings and lets you:

COMPARE returns a LOGICAL value representing the result of the logical expression, where the comparison rules are defined by the combination of the operator, the comparison strength, and the collation.

Syntax

COMPARE ( string1 , relational-operator , string2 , 
          strength [ , collation ] ) 

string1

A CHARACTER or LONGCHAR expression that evaluates to the first string to be compared.

relational-operator

A CHARACTER expression that evaluates to one of the relational operators, which are: LT (or <), LE (or <=), EQ (or =), GE (or >=), GT (or >), NE (or <>), “BEGINS”, and “MATCHES”.

string2

A CHARACTER or LONGCHAR expression that evaluates to the second string to be compared.

strength

A CHARACTER expression that evaluates to the Progress comparison strength or the International Components for Unicode (ICU) comparison strength to apply.

The Progress comparison strengths include:

collation

A CHARACTER expression that evaluates to the name of a Progress collation table or ICU collation. By default, Progress uses the collation rules you specify to compare characters and sort records. The collation rules specified with the Collation Table (-cpcoll) startup parameter take precedence over a collation specified for any database Progress accesses during the session, except when Progress uses or modifies pre-existing indexes. If you do not specify a collation with the -cpcoll startup parameter, Progress uses the language collation rules defined for the first database on the command line. If you do not specify a database on the command line, Progress uses the collation rules with the default name "basic" (which might or might not exist in the convmap.cp file).

If strength is not RAW or CAPS, the collation must be either a Progress collation table in the convmap.cp file or an ICU collation, and must be a valid collation table for the code page corresponding to the -cpinternal startup parameter.

Notes


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095